--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Commit 9cd0e66d8aa6dac478b6001f703ca6777f8f709c
Parents : e923aaf
Author : Ivan <ivan@quad4.io>
Signature : Invalid signer <e46112d44649266d71fe2193e00a4710>, author is <ivan@quad4.io>
Date : 2026-06-13T00:01:46-05:00
fix(database): correct snapshot name handling to include .zip extension and update download functionality in frontend
Changes
3 files changed, 5 insertions(+), 4 deletions(-)
Diff
diff --git a/meshchatx/src/backend/database/__init__.py b/meshchatx/src/backend/database/__init__.py
index 4af475a8..9cbe20d1 100644
--- a/meshchatx/src/backend/database/__init__.py
+++ b/meshchatx/src/backend/database/__init__.py
@@ -554,7 +554,7 @@ class Database:
stats = os.stat(full_path)
snapshots.append(
{
- "name": file[:-4],
+ "name": file,
"path": full_path,
"size": stats.st_size,
"created_at": datetime.fromtimestamp(
diff --git a/meshchatx/src/frontend/components/about/AboutPage.vue b/meshchatx/src/frontend/components/about/AboutPage.vue
index 0977a37c..e24c7169 100644
--- a/meshchatx/src/frontend/components/about/AboutPage.vue
+++ b/meshchatx/src/frontend/components/about/AboutPage.vue
@@ -1201,13 +1201,14 @@ export default {
},
async downloadSnapshot(filename) {
try {
+ const downloadName = filename.endsWith(".zip") ? filename : `${filename}.zip`;
const response = await window.api.get(`/api/v1/database/snapshots/${filename}/download`, {
responseType: "blob",
});
- const url = window.URL.createObjectURL(new Blob([response.data]));
+ const url = window.URL.createObjectURL(new Blob([response.data], { type: "application/zip" }));
const link = document.createElement("a");
link.href = url;
- link.setAttribute("download", filename);
+ link.setAttribute("download", downloadName);
document.body.appendChild(link);
link.click();
link.remove();
diff --git a/tests/backend/test_database_snapshots.py b/tests/backend/test_database_snapshots.py
index 5b1ca79b..1481d23c 100644
--- a/tests/backend/test_database_snapshots.py
+++ b/tests/backend/test_database_snapshots.py
@@ -48,7 +48,7 @@ def test_database_snapshot_creation(temp_dir):
# List snapshots
snapshots = db.list_snapshots(temp_dir)
assert len(snapshots) == 1
- assert snapshots[0]["name"] == snapshot_name
+ assert snapshots[0]["name"] == f"{snapshot_name}.zip"
def test_database_snapshot_restoration(temp_dir):
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────